# Contributor: Sui Libin <bygreencn@gmail.com>

_realname=vlfeat
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.9.21
pkgrel=1
pkgdesc="The VLFeat open source library implements popular computer vision algorithms specializing in image understanding and local features extraction and matching. (mingw-w64)"
arch=('any')
license=(BSD)
url="http://www.vlfeat.org"
depends=(""${MINGW_PACKAGE_PREFIX}-gcc-libs"")
makedepends=(""${MINGW_PACKAGE_PREFIX}-gcc"")
source=("http://www.vlfeat.org/download/${_realname}-${pkgver}.tar.gz"
        01-vlfeat-0.9.20-1-buildsys.mingw.patch)
sha256sums=('8cbf686fd008e3d119c3a0986ffd06e4c3d9448b6f4721a9cc9bb4964c82ff55'
            'ff1b998d5af23bcd3e0e5f4084d1d29a67e08c0b0a8c2f36829ad435278ffd5f')

prepare() {
  # Replace minizip with external
  cd ${srcdir}/${_realname}-${pkgver}
  patch -p1 -i ${srcdir}/01-vlfeat-0.9.20-1-buildsys.mingw.patch
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  make all
}

package() {
  cd ${srcdir}/${_realname}-${pkgver}
  make DESTDIR="${pkgdir}" prefix=${MINGW_PREFIX} install
}
